package com.huawei.appgallery.wishwall.ui.fragment;

import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.foundation.ui.framework.fragment.AppListFragment;
import com.huawei.appgallery.wishwall.ui.cardkit.bean.WishWallListCardBean;
import com.huawei.hmf.annotation.FragmentDefine;
import com.huawei.secure.android.common.intent.SafeBroadcastReceiver;
import o.cfv;
import o.cgi;
import o.chz;
import o.ddq.f;
import o.dec;
import o.ded;
import o.ContentManager;
import o.ll;

@FragmentDefine(alias = "wishwall.content.list")
public class WishWallContentFragment extends AppListFragment implements dec {
    private ded ˊ;
    private e ᐝ;

    final class e extends SafeBroadcastReceiver {
        final /* synthetic */ WishWallContentFragment ˎ;

        private e(WishWallContentFragment wishWallContentFragment) {
            this.ˎ = wishWallContentFragment;
        }

        public void onReceiveMsg(Context context, Intent intent) {
            String action = intent.getAction();
            if (action != null && action.contentEquals("action_local_brd_reply_state")) {
                int intExtra = intent.getIntExtra("reply_state", 0);
                this.ˎ.ˏ(intent.getStringExtra("wish_id"), intExtra);
            }
        }
    }

    public void ᐝʼ() {
        super.ᐝʼ();
        this.ॱꜟ = false;
    }

    public void ˏ(Bundle bundle) {
        super.ˏ(bundle);
        this.ᐝ = new e();
    }

    public View ˋ(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        this.ॱˍ = (ViewGroup) super.ˋ(layoutInflater, viewGroup, bundle);
        this.ߴ.setWarnImage(o.ddq.e.ˊ);
        this.ߴ.setWarnTextOne(ॱ(f.ॱ));
        return this.ॱˍ;
    }

    public void ˏ(ded o_ded) {
        this.ˊ = o_ded;
    }

    public void ˌॱ() {
        super.ˌॱ();
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction("action_local_brd_reply_state");
        ll.ˏ(ContentManager.getInstant().getContext()).ˏ(this.ᐝ, intentFilter);
    }

    public void ˋʼ() {
        super.ˋʼ();
        if (this.ᐝ != null) {
            ll.ˏ(ContentManager.getInstant().getContext()).ˋ(this.ᐝ);
        }
    }

    public cfv ˏ(String str, String str2, int i) {
        return cgi.ˏ(str, str2, i);
    }

    public boolean ˊ(TaskFragment taskFragment, b bVar) {
        boolean ˊ = super.ˊ(taskFragment, bVar);
        cgi o_cgi = (cgi) bVar.ˊ;
        if (this.ˊ != null && o_cgi.ˎ().contentEquals("mypublistwishwall")) {
            this.ˊ.ॱ(this.י.ˊॱ() > 0);
        }
        return ˊ;
    }

    public void ˊʻ() {
        ˏ(0);
        ʴ();
    }

    public void ˏ(String str, int i) {
        int i2 = 0;
        for (chz ˏ : this.י.ʻॱ()) {
            for (CardBean cardBean : ˏ.ˏ()) {
                WishWallListCardBean wishWallListCardBean = (WishWallListCardBean) cardBean;
                if (!(wishWallListCardBean.ॱ() == null || str == null || !wishWallListCardBean.ॱ().contentEquals(str))) {
                    wishWallListCardBean.ʼ(0);
                    if (i == 1) {
                        wishWallListCardBean.ʽ(1);
                    } else if (i == 2) {
                        wishWallListCardBean.ʽ(0);
                    }
                    i2 = 1;
                }
            }
        }
        if (i2 != 0) {
            this.י.ͺ();
        }
    }
}
